// src/router/index.js
import { createRouter, createWebHashHistory } from 'vue-router'
import LoginPage from '@/views/LoginPage.vue'
import RegisterPage from '@/views/RegisterPage.vue';
import HomePage from '@/views/HomePage.vue';
import RepairPersonHomePage from '@/views/RepairPersonHomePage.vue';
import AdministerHomePage from '@/views/AdministerHomePage.vue';
import timeCostPage from '@/views/timeCostPage.vue';
import costAnalysisPage from '@/views/costAnalysisPage.vue';

const routes = [
  { path: '/', redirect: '/login' }, // 根路径重定向到登录页面
  { path: '/login', component: () => LoginPage},
  {path:'/register',component:() =>RegisterPage},
  {path:'/user/home',component:() =>HomePage},
  {path:'/repair/home',component:()=>RepairPersonHomePage},
  {path:'/administrator/home',component:()=>AdministerHomePage},
  {path:'/timeCost', component: () => timeCostPage},
  {path:'/costAnalysis', component: () => costAnalysisPage}
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router